using Mono.Cecil.Cil;

public class Context
{
    private readonly TypeContext _context;
    private readonly MethodDefinition _method;
    public TypeDefinition Type => _context.Type;
    public MethodDefinition Method => _method;
    public string MethodName => _context.GetMethodName(_method);

    private Stack<Expression> _stack = new();

    public Context(TypeContext context, MethodDefinition method)
    {
        _method = method;
        _context = context;
    }

    public void Push(Expression instruction)
    {
        _stack.Push(instruction);
    }

    public Expression Pop()
    {
        return _stack.Pop();
    }
}